package com.yuerenjf.yuerenjinfu.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.umeng.analytics.MobclickAgent;
import com.yuerenjf.yuerenjinfu.R;
import com.yuerenjf.yuerenjinfu.event.CloseLoginEvent;

import org.greenrobot.eventbus.EventBus;


public class RegisterSuccessActivity extends BaseActivity {
    private TextView mRegister_success_chujie_text;
    private TextView mRegiter_success_wanshan_text;

    public static void launchActivity(Context context) {
        Intent intent = new Intent(context, RegisterSuccessActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        tv_title.setText("注册");
        ll_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
                EventBus.getDefault().post(
                        new CloseLoginEvent("CloseLoginEvent btn clicked"));
            }
        });




    }


    private void bindViews(View view) {

        mRegister_success_chujie_text = (TextView)view. findViewById(R.id.register_success_chujie_text);
        mRegiter_success_wanshan_text = (TextView)view.  findViewById(R.id.regiter_success_wanshan_text);

        mRegister_success_chujie_text.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(RegisterSuccessActivity.this, MainActivity.class);
                intent.putExtra("current","1");
                startActivity(intent);
                finish();
                EventBus.getDefault().post(
                        new CloseLoginEvent("CloseLoginEvent btn clicked"));
            }
        });

        mRegiter_success_wanshan_text.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(RegisterSuccessActivity.this, MainActivity.class);
                intent.putExtra("current","5");
                startActivity(intent);
                finish();
                EventBus.getDefault().post(
                        new CloseLoginEvent("CloseLoginEvent btn clicked"));
            }
        });
    }


    @Override
    protected View getChildView() {
        View view = View.inflate(this, R.layout.activity_register_success, null);
        bindViews(view);

        return view;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }


}
